package com.example.mapper;

import com.example.pojo.Area;
import com.example.pojo.UserArea;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.ResultMap;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface UserAreaMapper {

    @Select("select * from t_user_area where user_id=#{userId} and area_type=#{areaType} and del_flag=0")
    @ResultMap("UserAreaResult")
    UserArea selectByUserIdAndAreaType(@Param("userId") Long userId, @Param("areaType") Integer areaType);

    int batchUpdateByVillageId(List<Area> areaList);

    int batchInsert(List<UserArea> userAreaList);

    int batchUpdateByUserId(List<UserArea> userAreaList);

    int batchUpdateByAreaId(List<Area> areas2);

    int batchUpdateByUniversityId(List<Area> areas2);
}
